﻿#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include<QLabel>
#include<QComboBox>
#include<Qlineedit>
#include<QPushButton>
#include<QThread>
#include<QStackedLayout>
QT_BEGIN_NAMESPACE
namespace Ui {
class Widget;
}
QT_END_NAMESPACE

enum gun{
    AK47=1,
    LR300,
    MP5A4,
    THOMPSON,
    SMG,
    HMLMG,
    M249,
    SAR,
    M39,
    P250,
    M92,
    PROTOTYPE17,
    PYTHON ,
    REVOLVER
};

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();
    void layout();

private:
    Ui::Widget *ui;

    QLabel* lb_1;
    QLabel* lb_2;
    QLabel* lb_3;
    QLabel* lb_4;
    QLabel* lb_5;
    QLabel* lb_6;

    QComboBox* cbb_1;
    QComboBox* cbb_2;
    QComboBox* cbb_3;
    QComboBox* cbb_4;
    QComboBox* cbb_5;
    QComboBox* cbb_6;

    QPushButton* entergun;

    QLabel* lb_sens;
    QLabel* lb_ads_sens;
    QLabel* lb_fov;

    QLabel* lb_before;
    QLabel* lb_after;

    QLabel* lb_before_sens;
    QLabel* lb_before_ads_sens;
    QLabel* lb_before_fov;

    QLineEdit* le_sens;
    QLineEdit* le_ads_sens;
    QLineEdit* le_fov;

    QPushButton* enterchange;

    QPushButton* start;

    QStringList guns;
    QThread *luathread;

    QStackedLayout *sl;

    QWidget* setting_w;
    QWidget* start_w;

    QPushButton* back;
    QLabel* gun;
    QLabel* scope;
    QLabel* name;
    QLabel* gunname;
    QLabel* scopename;
    QLabel* pic;
    QLabel* gunpic;
    QLabel* scopepic;


signals:
    void getsetting();
    void getguns();
    void set_sens(double);
    void set_ads_sens(double);
    void set_fov(int);
    void setcbb(int,int,int,int,int,int);
    void getguninfo();
    void getscopeinfo(QString);

private slots:
    void setting_sens(float sens);
    void setting_ads_sens(float ads_sens);
    void setting_fov(int fov);

    void set_cbb1(int index);
    void set_cbb2(int index);
    void set_cbb3(int index);
    void set_cbb4(int index);
    void set_cbb5(int index);
    void set_cbb6(int index);

    void setsetting();
    void setguns();

    void setgun(int index);
    void setscope(QString scope);
};
#endif // WIDGET_H
